# -*- encoding: utf-8 -*-
from django.shortcuts import render_to_response, get_list_or_404,\
    get_object_or_404
from page.models import Page
from django.conf import settings
from django.utils.safestring import mark_safe
from django.template.context import RequestContext

def obterPorNome(request,page_nome):
    pagina = get_object_or_404(Page, nome=page_nome)
    pagina.conteudo = mark_safe(pagina.conteudo)
    return render_to_response('pagina/index.html', {'pagina':pagina},context_instance=RequestContext(request))

